home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Event / c / MRelMsg < prev    next >
Text File  |  1995-07-08  |  2KB  |  50 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Event.MRelMsg.c
  12.     Author:  Copyright © 1992 Jason Williams
  13.     Version: 1.00 (16 Mar 1992)
  14.     Purpose: Extension to Event.c to allow routing of specific message types
  15.              to different windows' message handlers.
  16. */
  17.  
  18. #include "EMsgDefs.h"
  19.  
  20.  
  21.  
  22. extern BOOL EventMsg_ReleaseMessage(message_action messagetype)
  23. {
  24.   eventmsg_claimrecord *ptr;
  25.   eventmsg_windowrecord *wptr, *next;
  26.  
  27.   ptr = (eventmsg_claimrecord *) eventmsg__claimanchor.next;
  28.  
  29.   while (ptr != NULL)
  30.   {
  31.     if (ptr->messagetype == messagetype)
  32.     {
  33.       wptr = (eventmsg_windowrecord *) ptr->windowlist.next;
  34.       while (wptr != NULL)                      /* Release all window claims */
  35.       {
  36.         next = (eventmsg_windowrecord *) wptr->header.next;
  37.         free(wptr);
  38.         wptr = next;
  39.       }
  40.  
  41.       LinkList_Unlink(&eventmsg__claimanchor, &(ptr->header));
  42.                                                       /* remove message type */
  43.       free(ptr);                                      /* free memory up      */
  44.       return(TRUE);
  45.     }
  46.     ptr = (eventmsg_claimrecord *) ptr->header.next;
  47.   }
  48.   return(FALSE);
  49. }
  50.